package com.bby.disk.service;

import com.bby.common.exception.BBYException;
import com.bby.disk.bean.UploadStatus;
import com.bby.disk.bean.req.OfflineTaskReq;
import com.bby.disk.bean.req.SimpleUploadData;
import com.bby.disk.bean.req.UploadTaskInfo;
import com.bby.disk.manager.upload.OfflineTask;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

public interface IUploadService {


    UploadStatus getUploadStatus(String guid) throws BBYException;

//
//    ServiceResult uploadPartTrunk(String userId, ChunkedUploadData uploadData) throws Exception;
//
//    ServiceResult uploadPartFast(String userId, ChunkedUploadData uploadData);

    void simpleUploadFile(String userId, String guid, SimpleUploadData uploadData) throws BBYException;

    void preUpload(String userId, UploadTaskInfo uploadTaskInfo) throws BBYException;

    // 以下是离线任务
    OfflineTask addOfflineTask(String userId, OfflineTaskReq req) throws BBYException;

    List<OfflineTask> getOfflineTaskList(String userId) throws BBYException;
    void retryThreadTask(String userId, String taskId) throws BBYException;

    void removeOfflineTask(String userId, String taskId) throws BBYException;

    long getOfflineTaskFinished(String userId, String taskId) throws BBYException;

    // 以下是头像
    void setAvatar(String userId, MultipartFile avatar) throws BBYException;

    OfflineTask getOfflineTask(String userId, String taskId) throws BBYException;

    void delTask(String guid);
}
